1. Field of the Invention
The present invention relates to an image correction apparatus and an image correction method for correcting gradation values in image data.
2. Description of the Related Art
A digital image is an image in which the value of each pixel is represented as a single sample, typically composed of shades of gray, varying from black at the weakest intensity to white at the strongest. Gray-scale images intended for visual display are typically stored with 8 bits per sampled pixels, thereby allowing 256 intensities (i.e. shades of gray, or gray-scale levels, or gray levels) to be recorded. A color image may be recorded, for example, with 24 bits per pixel, e.g. RGB (red, green, blue) 8:8:8. The terms “gray-scale level” and “gray level” will be used interchangeably herein.
Image correction methods that correct the gradation level (gray level) of digital images presented on a monitor or other type of image display device according to a user setting are known from the literature. Images can be corrected as needed by the user by adjusting the gray level of the value of the pixels forming the image. Various methods can be used to correct the brightness (value) information in digital images, and gamma correction is one method of correcting image brightness and contrast by adjusting the gamma curve. The gamma curve is a function representing the relationship between the gray level of the input signal on the x-axis and the gray level of the output signal on the y-axis. As shown in FIG. 10, for example, if the input signal on the x-axis and the output signal on the y-axis can range from 0 (dark) to 255 (light) and the gamma curve 50 is a ramp with a slope of 45°, the input value and the output value are the same and no gamma correction is applied. Image brightness and contrast can be precisely adjusted by adjusting this gamma curve.
Referring to FIG. 11 and Japanese Unexamined Patent Appl. Pub. 2005-77638, when the gamma curve 51 is in the domain under the ramp with a slope of 45° (such as when the gamma curve (called a “tone curve” in the cited application) is downwardly concave with a low slope on the low gray level side and a steep slope on the high gray level side), the range of gray scale values in the image is compressed into the low gray level domain and the overall image becomes darker. Conversely, when the gamma curve 52 is in the domain above the ramp (such as when the gamma curve is upwardly concave with a steep slope on the low gray level side and a gradual slope on the high gray level side), the range of gray scale values in the image expands into the high gray level domain and the overall image becomes brighter.
The gamma function f(x) gives the curve of the brightness correction afforded by the gamma curve. The gamma function resulting in the lowest image brightness (black) is f(x)=0 as denoted by curve (straight line in this instance) 53 in FIG. 12, and the gamma function resulting in the greatest image brightness (white) is f(x)=255 as denoted by curve (straight line in this instance) 54 in FIG. 12. However, if gamma correction ranges from f(x)=0-255 and gamma is set to f(x)=0, gray level 0 will be output for all input values, the output image will be the darkest displayable image, that is, completely black, and no image details will be discernible. Likewise, if gamma correction is set to f(x)=255, gray level 255 will be output for all input values, the output image will be the brightest displayable image, that is, completely white, and no image details will be discernible.
The correction range is therefore reduced to enable converting the input image to a usable output image and not output a completely black or a completely white image. More specifically, displaying a completely black or a completely white image is prevented by not applying gamma correction using specific functions including f(x)=0 and f(x)=255 indicated by the shaded areas (a) and (b) in FIG. 11.
However, when the correction range is limited as described above, the correction range (c) in FIG. 11 for brightening an image that is dark overall is the same size as the correction range (d) in FIG. 11 for darkening an image that is bright overall regardless of the actual image brightness level because the correction range is limited so that the center of the correction range is a simple line with a slope of 45°, even though the correction needed to brighten (darken) an image that is dark (light) overall is greater than the correction needed to darken (brighten) the image.
If the correction range for increasing image brightness and the correction range for decreasing image brightness are the same size, the correction process may needlessly brighten an image that is light overall (such as a source image that contains text) where the correction needed to further brighten the image is less than the correction needed to darken the image. More specifically, depending upon the user settings, conversion using a function f(x) that brightens the image more than the correction range that is actually appropriate to the image may be needlessly applied. This also applies to images that are dark overall. The resulting image may therefore not enable reading individual characters in a block of text, for example, due to image whiteout or blackout.
The image correction apparatus and image correction method of this invention enable correcting images so that image recognition, and particularly reading text in the image, is possible regardless of the user settings.